import 'dart:async';
import 'package:demo/event/event_setting.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:demo/views/base/base_controller.dart';
import 'package:demo/tools/tools_enum.dart';

class MinePassController extends BaseController {
  // 密码
  TextEditingController passController = TextEditingController();

  // 提交
  Future<void> submit() async {
    // 通知
    EventSetting().handle(
      SettingModel(
        SettingType.mine,
        label: 'pass',
        value: 'Y',
      ),
    );
    // 提醒
    EasyLoading.showToast('设置密码成功');
    // 跳转
    Get.back();
  }

  @override
  void onClose() {
    passController.dispose();
    super.onClose();
  }
}
